package com.jctrip.hotel.source.mq;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author：Haruhi
 * @description:
 * @Date：2023/12/12 15:26
 * @Package：com.jctrip.hotel.source.mq
 * @Project：hotel-main
 */

@Slf4j
@Component
public class IncrHotelRocketMqProducer {

//    @Resource(name = "incrHotelDefaultMQProducer")
//    private DefaultMQProducer incrHotelDefaultMQProducer;
//
    public void send(String msg) {
//        Message message = new Message("incrHotelId", "", msg.getBytes());
        try {
//            incrHotelDefaultMQProducer.send(message, new SendCallback() {
//                @Override
//                public void onSuccess(SendResult sendResult) {
//                }
//
//                @Override
//                public void onException(Throwable throwable) {
//                    log.error("send log callback error!", throwable);
//                }
//            });
        } catch (Exception e) {
            log.error("send log error!", e);
        }
    }
}